﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GameHelper
{
    public partial class QQMemberFind : Form
    {
        public QQMemberFind()
        {
            InitializeComponent();
        }

        public void StartAttacking()
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            AddMember();
        }

        private void AddMember()
        {
            System.Threading.Thread.Sleep(3000);
            int i = 0;
            while (true)
            {

                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Enter);//
                System.Threading.Thread.Sleep(1000);
                //WindowAPI.Clipboard.SetWords("QQ群发程序，网页程序开发，游戏脚本编写，有意请联系QQ231583609");
                //System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardGroup(Keys.LControlKey, Keys.V);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Enter);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Enter);
                System.Threading.Thread.Sleep(1000);
                WindowAPI.ApiHelper.KeyBoardClick(Keys.Down);
                System.Threading.Thread.Sleep(1000);
                i++;
                if (i == 9)
                {
                    i = 0;
                    WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                    System.Threading.Thread.Sleep(1000);
                    WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                    System.Threading.Thread.Sleep(1000);
                    WindowAPI.ApiHelper.KeyBoardClick(Keys.Tab);
                    System.Threading.Thread.Sleep(1000);
                    WindowAPI.ApiHelper.KeyBoardClick(Keys.Enter);
                }
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {

        }
    }

    class QQMember
    {
        public int? Id { get; set; }

        public string UName { get; set; }

        public string QQCode { get; set; }

        public void Insert()
        {
            Common.ADO.DBManager.Insert(this);
        }

        public bool IsExist()
        {
            QQMember member = new QQMember();
            member.QQCode = this.QQCode;
            List<object> objs = Common.ADO.DBManager.GetSomeObject(member);
            if (objs.Count > 0)
            {
                return true;
            }
            else
            {
                return false;
            }

        }
    }
}
